import request from '@/router/axios'

// 销售属性
export function operateAttrPage(query) {
    return request({
        url: '/pms-api/pms/sku/name/operateAttrPage',
        method: 'get',
        params: query
    })
}

export function operateDAttr(query) {
    return request({
        url: '/pms-api/pms/sku/name/operateDAttr',
        method: 'get',
        params: query
    })
}

export function operateSKPage(query) {
    return request({
        url: '/pms-api/pms/sku/name/operateSKPage',
        method: 'get',
        params: query
    })
}

export function operateDSK(query) {
    return request({
        url: '/pms-api/pms/sku/name/operateDSK',
        method: 'get',
        params: query
    })
}


//------- 分类 --------
export function getSortList(query) {
    return request({
        url: '/pms-api/pms/sort/listSort',
        method: 'get',
        params: query
    })
}

export function getSort(query) {
    return request({
        url: '/pms-api/pms/sort/getSort/' + query,
        method: 'get',
    })
}

export function examineSort(query) {
    return request({
        url: '/pms-api/pms/sort/examineSort',
        method: 'post',
        data: query
    })
}

export function listSalesAttr() {
    return request({
        url: '/pms-api/pms/product/listAllSort',
        method: 'get',
    })
}

// --- 商品管理 -------
export function operatePPage(query) {
    return request({
        url: '/pms-api/pms/product/operatePPage',
        method: 'get',
        params: query
    })
}

export function productDetails(data) {
    return request({
        url: '/pms-api/pms/product/productDetails',
        method: 'get',
        params: data
    })
}

export function adoptProduct(data) {
    return request({
        url: '/pms-api/pms/product/adoptProduct',
        method: 'get',
        params: data
    })
}

export function noAdoptProduct(data) {
    return request({
        url: '/pms-api/pms/product/noAdoptProduct',
        method: 'post',
        data: data
    })
}

export function operateOffProduct(data) {
    return request({
        url: '/pms-api/pms/product/operateOffProduct',
        method: 'post',
        data: data
    })
}

// --- 运费 -----
export function fetchList(params) {
    return request({
        url: '/pms-api/pms/freight/operate/page',
        method: 'get',
        params: params
    })
}

export function deleteFreight(params) {
    return request({
        url: '/pms-api/pms/freight/operate/remove/' + params,
        method: 'delete',
    })
}

export function lookFreight(params) {
    return request({
        url: '/pms-api/pms/freight/operate/get/product',
        method: 'get',
        params: params
    })
}